//
//  ColorButton.m
//  MooreDoll
//
//  Created by 郭景豪 on 2014/11/26.
//  Copyright (c) 2014年 Tank. All rights reserved.
//

#import "ColorButton.h"
#import "UIColor+UIColor_Category.m"
@implementation ColorButton
/*
 button 加圓角
 */
-(id)initWithCoder:(NSCoder *)aDecoder
{
    self = [super initWithCoder:aDecoder];
    if (self) {
        
        self.layer.cornerRadius = 2;
        self.tintColor = [UIColor whiteColor];
        self.titleLabel.font = [UIFont fontWithName:@"Arial-BoldMT" size:18.0f];
        self.backgroundColor = [UIColor colorWithRed:255.0/255.0f green:127.0/255.0f blue:13.0/255.0f alpha:1];

    }
    return self;
}
/*
 button 按下去的顏色改變
 */
-(void)setHighlighted:(BOOL)highlighted
{
    [super setHighlighted:highlighted];
    
    if (highlighted) {
        self.backgroundColor = [UIColor colorWithHexString:@"#b75900"];
    }
    else {
        self.backgroundColor = [UIColor colorWithRed:255.0/255.0f green:127.0/255.0f blue:13.0/255.0f alpha:1];
    }
}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
